package com.android.telephonecall.model;

public class MqttCommandModel {

    /**
     * requestId : 消息唯一ID，UUID
     * timestamp : 消息发送时间，13长度时间戳
     * deviceId : 手机设备唯一ID
     * action : 执行的操作
     * param : {}
     */

    private String requestId;
    private String timestamp;
    private String deviceId;
    private String action;
    private ParamBean param;

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public ParamBean getParam() {
        return param;
    }

    public void setParam(ParamBean param) {
        this.param = param;
    }

    public static class ParamBean {
        private int code;
        private String msg;

        //上传手机号信息
        private String info;                      //手机型号、安卓版本等信息
        private String version;                  //APP版本号
        private String numbers;                  //手机上插入的多个手机号

        private String upgradeVersion;           //APP有可用的版本更新
        private String content;                  //版本内容说明
        private String url;                      //没有更新时，不返回
        private int isFocus;                     //强制更新，不更新不能使用

        //通话状态实时同步: 实时同步通话状态给服务端，包括来电、拒接、挂断、挂起、呼出等操作时;
        private int status;                      //1:空闲(可拨号) 2:通话中 3:其他状态
        private int type;                        //通话状态：1:来电 2:拒接 3:挂断 4:呼出 5:其他  通话记录上传:1:呼入 2:呼出
        private String localNumber;              //本机号码
        private String number;                   //来电号吗或呼出号码

        //通话记录上传: 实时同步通话状态给服务端，包括来电、拒接、挂断、挂起、呼出等操作时;
        private String recordId;                 //通话记录ID
        private String fromNumber;               //拨出的号码
        private String toNumber;                 //被叫号码
        private String startTime;                //开始时间
        private String endTime;                  //结束时间

        //录音文件上传
        private String name;                     //文件名，默认为 {recordId}.mp3
        private long size;                       //文件总大小
        private String checksum;                 //文件hash256值
        private String createTime;               //录音文件产生时间
        private String deviceId;                 //设备ID

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public String getInfo() {
            return info;
        }

        public void setInfo(String info) {
            this.info = info;
        }

        public String getVersion() {
            return version;
        }

        public void setVersion(String version) {
            this.version = version;
        }

        public String getNumbers() {
            return numbers;
        }

        public void setNumbers(String numbers) {
            this.numbers = numbers;
        }

        public String getUpgradeVersion() {
            return upgradeVersion;
        }

        public void setUpgradeVersion(String upgradeVersion) {
            this.upgradeVersion = upgradeVersion;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public int getIsFocus() {
            return isFocus;
        }

        public void setIsFocus(int isFocus) {
            this.isFocus = isFocus;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getLocalNumber() {
            return localNumber;
        }

        public void setLocalNumber(String localNumber) {
            this.localNumber = localNumber;
        }

        public String getNumber() {
            return number;
        }

        public void setNumber(String number) {
            this.number = number;
        }

        public String getRecordId() {
            return recordId;
        }

        public void setRecordId(String recordId) {
            this.recordId = recordId;
        }

        public String getFromNumber() {
            return fromNumber;
        }

        public void setFromNumber(String fromNumber) {
            this.fromNumber = fromNumber;
        }

        public String getToNumber() {
            return toNumber;
        }

        public void setToNumber(String toNumber) {
            this.toNumber = toNumber;
        }

        public String getStartTime() {
            return startTime;
        }

        public void setStartTime(String startTime) {
            this.startTime = startTime;
        }

        public String getEndTime() {
            return endTime;
        }

        public void setEndTime(String endTime) {
            this.endTime = endTime;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public long getSize() {
            return size;
        }

        public void setSize(long size) {
            this.size = size;
        }

        public String getChecksum() {
            return checksum;
        }

        public void setChecksum(String checksum) {
            this.checksum = checksum;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public String getDeviceId() {
            return deviceId;
        }

        public void setDeviceId(String deviceId) {
            this.deviceId = deviceId;
        }

        @Override
        public String toString() {
            return "ParamBean{" +
                    "code=" + code +
                    ", msg='" + msg + '\'' +
                    ", info='" + info + '\'' +
                    ", version='" + version + '\'' +
                    ", numbers='" + numbers + '\'' +
                    ", upgradeVersion='" + upgradeVersion + '\'' +
                    ", content='" + content + '\'' +
                    ", url='" + url + '\'' +
                    ", isFocus=" + isFocus +
                    ", status=" + status +
                    ", type=" + type +
                    ", localNumber='" + localNumber + '\'' +
                    ", number='" + number + '\'' +
                    ", recordId='" + recordId + '\'' +
                    ", fromNumber='" + fromNumber + '\'' +
                    ", toNumber='" + toNumber + '\'' +
                    ", startTime='" + startTime + '\'' +
                    ", endTime='" + endTime + '\'' +
                    ", name='" + name + '\'' +
                    ", size=" + size +
                    ", checksum='" + checksum + '\'' +
                    ", createTime='" + createTime + '\'' +
                    ", deviceId='" + deviceId + '\'' +
                    '}';
        }
    }

    @Override
    public String toString() {
        if (param != null) {
            return "MqttCommandModel{" +
                    "requestId='" + requestId + '\'' +
                    ", timestamp='" + timestamp + '\'' +
                    ", deviceId='" + deviceId + '\'' +
                    ", action='" + action + '\'' +
                    ", param=" + param.toString() +
                    '}';
        } else {
            return "MqttCommandModel{" +
                    "requestId='" + requestId + '\'' +
                    ", timestamp='" + timestamp + '\'' +
                    ", deviceId='" + deviceId + '\'' +
                    ", action='" + action + '\'' +
                    ", param=" + param +
                    '}';
        }
    }
}
